import Request from '@/utils/request'


export const fetchMenuTree = () => {
    return Request({
        url: '/sys/menu/menuTree',
        method: 'get',
    })
}

export const fetchEntryMenuTree = () => {
    return Request({
        url: '/sys/menu/entryMenuTree',
        method: 'get',
    })
}

export const saveMenu = data => {
    return Request({
        url: '/sys/menu/saveMenu',
        method: 'post',
        data: data
    })
}

export const deleteMenu = (id) => {
    return Request({
        url: `/sys/menu/deleteMenu/${id}`,
        method: 'get',
    })
}

export const fetchMenuOne = (id) => {
    return Request({
        url: `/sys/menu/menuOne/${id}`,
        method: 'get',
    })
}

export const editMenu = data => {
    return Request({
        url: '/sys/menu/editMenu',
        method: 'post',
        data: data
    })
}
